package com.ruoyi.bussiness.api;

import cn.hutool.json.JSONObject;
import com.ruoyi.common.core.api.ApiResult;
import com.ruoyi.common.core.domain.entity.AppWxParam;
import com.ruoyi.common.dto.LoginDTO;
import com.ruoyi.common.param.ProductParam;
import com.ruoyi.common.service.business.*;
import com.ruoyi.common.vo.business.LoginWxVo;
import com.ruoyi.common.vo.business.ProductVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/ma/product")
@Slf4j
@Api(value = "微信小程序")
public class ApiProductController {

    @Autowired
    private ProductCategoryService categoryService;
    @Autowired
    private ProductService productService;
    @Autowired
    private ShoppingCartService cartService;


    @RequestMapping(value = "/getDetail",method = RequestMethod.GET)
    @ApiOperation(value = "获取商品详情")
    public ApiResult<ProductVo> getDetail(Long productId){
        return ApiResult.ok(productService.getDetail(productId));
    }
}
